#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
class Date
{
public:
	Date(int year, int month, int day)
		:_year(year)
		, _month(month)
		, _day(day)
	{}

	int getDay(int year, int month)
	{
		static int day_arr[] = { -1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

		if (month == 2 && ((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0)))
			return 29;
		else
			return day_arr[month];
	}

	Date& operator+=(int x)
	{
		_day += x;
		while (_day > getDay(_year, _month))
		{
			_day -= getDay(_year, _month);
			_month ++;
			if (_month == 13)
			{
				_month = 1;
				_year++;
			}
		}
		return *this;
	}
	
	bool operator<(Date& d)
	{
		if (_year < d._year)
			return true;
		else if (_year < d._year && _month < d._month)
			return true;
		else if (_year == d._year && _month == d._month && _day <= d._day)
			return true;
		else
			return false;
	}

	bool operator==(Date& d)
	{
		return (_year == d._year && _month == d._month && _day == d._day);
	}

	bool operator!=(Date& d)
	{
		return !(*this == d);
	}

	int operator-(Date& d) const
	{
		Date max = *this;
		Date min = d;
		if (max < min)
		{
			max = d;
			min = *this;
		}
		int count = 0;
		while (min != max)
		{
			min += 1;
			count++;
		}
		return count + 1;
	}

private:
	int _year;
	int _month;
	int _day;
};

//int isLeapYear(int year)
//{
//	if (((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0)))
//		return 366;
//	else
//		return 365;
//}

int main()
{
	int year1, month1, day1, year2, month2, day2;

	cin >> year1;
	cin >> year2;
	//year1 = 10000101;
	//year2 = 10010201;

	day1 = year1 % 100;
	day2 = year2 % 100;

	year1 /= 100;
	year2 /= 100;

	month1 = year1 % 100;
	month2 = year2 % 100;

	year1 /= 100;
	year2 /= 100;

	Date d1(year1, month1, day1);
	Date d2(year2, month2, day2);

	cout << d1 - d2 << endl;

	return 0;
}